package com.cn.xiaonuo.sys.modular.news.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.xiaonuo.sys.modular.news.entity.News;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface NewsMapper extends BaseMapper<News> {

//    @Query("select n from News n where n.recommend = true")
//    List<News> findTop(Pageable pageable);
//
//    @Query("select n from News n where n.title like ?1 or n.content like ?1")
//    Page<News> findByQuery(String query,Pageable pageable);
//
//
//    @Query("select function('date_format',n.updateTime,'%M') as month from News n group by function('date_format',n.updateTime,'%M') order by month DESC ")
//    List<String> findGroupBy();
//
//
//    @Transactional
//    @Modifying
//    @Query("update News n set n.views = n.views+1 where n.id = ?1")
//    int updateViews(Long id);
//
//
//    @Query("select n from News n where function('date_format',n.updateTime,'%M') = ?1")
//    List<News> findByMonth(String month);

}
